package demo;

public class MessageSender {
    private Handler handler;

    public MessageSender(Handler handler) {
        this.handler = handler;
    }

    public void sendMessage(int what, Object obj) {
        Message message = new Message(what, obj);
        handler.handleMessage(message);
    }
}

